


public class ExOnGarbageCollector {
	
	public boolean isGreaterVersionCheck(String s1, String s2) {
		
		try {
			if ((s1 != null && !s1.trim().equals("")) && (s1 != null && !s1.trim().equals(""))) {
				if (s1.contains(".") && s2.contains(".")) {
					String str1[] = s1.split("\\.");
					String str2[] = s2.split("\\.");
					if (Integer.valueOf(str1[0]) > Integer.valueOf(str2[0])) {
						return true;
					}
					if (Integer.valueOf(str1[1]) > Integer.valueOf(str2[1])) {
						return true;
					}

				} else if (s1.contains(".") && !s2.contains(".")) {
					return false;
				} else if (!s1.contains(".") && s2.contains(".")) {
					return false;
				} else if (Integer.valueOf(s1) > Integer.valueOf(s2)) {
					return true;
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
		
	}
	public static void main(String[] args) {
		/*Runtime rt = Runtime.getRuntime();
		System.out.println(rt.freeMemory());
		Date d = null;
		for(int i=0; i<1000; i++){
			d= new Date();
		}
		System.out.println(rt.maxMemory());
		System.out.println(rt.freeMemory());
		rt.gc();
		System.out.println(rt.freeMemory());*/
		/*String s="ramakrishna";
		String revString ="";
		for(int i=s.length()-1; i>=0; --i){
			revString +=s.charAt(i);
			
		}RR
		System.out.println(revString);*/
		/*float a = 2012.1f;

		int d = (int) Math.ceil(a);

		System.out.println(d);
		
		Float f =Math.abs(Float.valueOf("2012.10"));
		int i = Math.round(Float.valueOf("2012.10"));
		System.out.println(i);
		Float f1 = Math.abs(Float.valueOf("2012.9"));
		if(f> f1){
			System.out.println("greater");
		}else {
			System.out.println("not eqval");
		}*/
		
		String s1= "2013.10";
		String s2 ="2013.2";
		
		ExOnGarbageCollector ex = new ExOnGarbageCollector();
		boolean flag  = ex.isGreaterVersionCheck(s1.trim(), s2.trim());
		System.out.println("flag value \b"+flag);
		
		
		
			
		
	}
	
}
